package com.smedi.ismedi.progress.core.application.query.Impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.smedi.ismedi.progress.core.application.command.ConstructionLogDetailQuery;
import com.smedi.ismedi.progress.core.application.command.ConstructionLogListQuery;
import com.smedi.ismedi.progress.core.application.command.ConstructionLogQuery;
import com.smedi.ismedi.progress.core.application.command.ConstructionLogSaveAndDraft;
import com.smedi.ismedi.progress.core.application.query.ConstructionLogQueryService;
import com.smedi.ismedi.progress.core.application.query.ConstructionLogService;
import com.smedi.ismedi.progress.core.domain.aggregatemodel.ConstructionLog;
import com.smedi.ismedi.progress.core.domain.aggregatemodel.ConstructionLogDetail;
import com.smedi.ismedi.progress.core.domain.aggregatemodel.ConstructionLogWeather;
import com.smedi.ismedi.progress.core.domain.repository.ConstructionLogRepository;
import com.smedi.ismedi.progress.core.port.adapter.persistence.model.ConstructionLogEntity;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 施工日志查询实现
 *
 * @author liaojiajie
 * @date 2022/09/16
 */
@Service
@AllArgsConstructor
public class ConstructionLogServiceImpl implements ConstructionLogService {

    private final ConstructionLogRepository constructionLogRepository;

    @Override
    public List<ConstructionLogWeather> constructionContext(ConstructionLogQuery constructionLogQuery) {
        return constructionLogRepository.constructionContext(constructionLogQuery);
    }

    @Override
    public ConstructionLogSaveAndDraft saveReportAndDetial(ConstructionLogSaveAndDraft constructionLogSaveAndDraft) {
        return constructionLogRepository.saveReportAndDetial(constructionLogSaveAndDraft);
    }

    @Override
    public ConstructionLogSaveAndDraft getConstructionLogOne(ConstructionLogSaveAndDraft constructionLog) {
        return constructionLogRepository.getConstructionLogOne(constructionLog);
    }

    @Override
    public void updateConstructionLog(ConstructionLogSaveAndDraft constructionLogQuery) {
        constructionLogRepository.updateConstructionLog(constructionLogQuery);
    }

    @Override
    public ConstructionLogEntity getConstructionLog(ConstructionLogSaveAndDraft constructionLogSaveAndDraft) {
        return constructionLogRepository.getConstructionLog(constructionLogSaveAndDraft);
    }

    @Override
    public Integer findConstructionLog(String firstDay, Long projectId) {
        return constructionLogRepository.findConstructionLog(firstDay,projectId);
    }
}
